package org.unique.support.druid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.unique.ioc.AbstractBeanFactory;
import org.unique.ioc.impl.SingleBean;
import org.unique.support.Support;
import org.unique.support.orm.ds.DataSourceFactory;

/**
 * Object Relational Mapping
 * @author biezhi
 * @version 1.0
 */
public class DruidSupport extends Support {

	private Logger logger = LoggerFactory.getLogger(DruidSupport.class);
	
	@Override
	public void startup() {
		AbstractBeanFactory beanfactory = new SingleBean();
		if(null != beanfactory.getBean(DataSourceFactory.class)){
			logger.info("druid增强加载成功！");
			this.status = 1;
		} else{
			logger.error("druid增强加载失败！");
		}
	}

	@Override
	public void shutdown() {
		this.status = 0;
	}
}
